package com.ali.edu.web.controller;

import com.ali.edu.model.User;
import com.ali.edu.service.UserService;
import com.ali.edu.web.controller.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class UserController extends BaseController<User> {

    @Autowired
    private UserService userService;

    @RequestMapping("/login")
    public String login() {
//        System.out.println("UserController.login()……");
        return "Default";
    }

    @RequestMapping("/select")
    public String select(Integer id) {
        User user = userService.selectById(id);
        System.out.println(user);
        return null;
    }

    @RequestMapping(MANAGE)
    public String manage() {
        return MANAGE_PAGE;
    }

    @RequestMapping(INFO)
    public String info() {
        return INFO_PAGE;
    }

    @RequestMapping(EDIT)
    public String edit() {
        return EDIT_PAGE;
    }

}
